import java.io.InputStream;
import java.net.URL;

import com.encrypt.classloader.MainDecryptClassLoader;

public class Test {
	public static void main(String[] args) throws Exception {
		// testURL();
		testClassLoader();
	}

	private static void testURL() {
		URL url = Test.class.getClassLoader().getResource("main.properties");
		System.err.println(url);
	}

	private static void testClassLoader() throws Exception {
		ClassLoader loader;
		String classPath = "bin-o;test-o.jar";
		loader = new MainDecryptClassLoader(classPath);
		Class<?> clazz = loader.loadClass("Regex2Line");
		System.err.println(clazz.newInstance()+"  "+clazz.getClassLoader());
		InputStream res = loader.getResourceAsStream("config.properties");
		byte[] data = new byte[res.available()];
		res.read(data);
		System.err.println(new String(data));
	}
}
